package cn.edu.njpi;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;

/**
 * @author 朱宗辉
 * @version V1.0
 * @Package cn.edu.njpi
 * @date 2022/5/10 9:21 PM
 */
public class Main extends Application {
    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage stage) throws Exception {
        Button b1 = new Button("b1");
        b1.setLayoutX(0);
        b1.setLayoutY(0);
        b1.setPrefWidth(50);
        b1.setPrefHeight(50);
        Button b2 = new Button("b2");
        b2.setLayoutX(100);
        b2.setLayoutY(0);
        b2.setPrefWidth(50);
        b2.setPrefHeight(50);
        Button b3 = new Button("b3");
        b3.setLayoutX(200);
        b3.setLayoutY(0);
        b3.setPrefWidth(50);
        b3.setPrefHeight(50);
        Group group = new Group();
        group.getChildren().addAll(b1, b2, b3);
        //group.getChildren().remove(b1);
        //group.setAutoSizeChildren(false);
        //group.setOpacity(0.45);
        System.out.println("group.contains(0, 0) = " + group.contains(0, 0));
        for (Object o : group.getChildren().toArray()) {

        }
        Scene scene = new Scene(group);
        stage.setScene(scene);
        stage.setTitle("javafx");
        stage.setHeight(800);
        stage.setWidth(800);
        stage.show();
    }
}
